<?php

use yii\db\Migration;

class m180628_001432_rename_tables extends Migration
{
    public function up()
    {
        $this->renameTable('ad', 'ads');
        $this->renameTable('case', 'cases');
        $this->renameTable('case_product', 'case_products');
        $this->renameTable('case_gallery', 'case_galleries');
        $this->renameTable('menu', 'menus');
        $this->renameTable('order', 'orders');
        $this->renameTable('order_product', 'order_products');
        $this->renameTable('product', 'products');
        $this->renameTable('product_gallery', 'product_galleries');
        $this->renameTable('user', 'users');
        $this->renameTable('partner', 'partners');
    }

    public function down()
    {
        $this->renameTable('ads', 'ad');
        $this->renameTable('cases', 'case');
        $this->renameTable('case_products', 'case_product');
        $this->renameTable('case_galleries', 'case_gallery');
        $this->renameTable('menus', 'menu');
        $this->renameTable('orders', 'order');
        $this->renameTable('order_products', 'order_product');
        $this->renameTable('products', 'product');
        $this->renameTable('product_galleries', 'product_galleries');
        $this->renameTable('users', 'user');
        $this->renameTable('partners', 'partner');
    }
}
